<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Set the OID output format</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.snmp-set-oid-numeric-print.html">snmp_set_oid_numeric_print</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.snmp-set-quick-print.html">snmp_set_quick_print</a></div>
 <div class="up"><a href="ref.snmp.html">SNMP 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.snmp-set-oid-output-format" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">snmp_set_oid_output_format</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0)</p><p class="refpurpose"><span class="refname">snmp_set_oid_output_format</span> &mdash; <span class="dc-title">
   Set the OID output format
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.snmp-set-oid-output-format-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>snmp_set_oid_output_format</strong></span>
    ( <span class="methodparam"><span class="type">int</span> <code class="parameter">$oid_format</code><span class="initializer"> = SNMP_OID_OUTPUT_MODULE</span></span>
   )</div>

  <p class="para rdfs-comment">
   <span class="function"><strong>snmp_set_oid_output_format()</strong></span> sets the output format
   to be full or numeric.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-function.snmp-set-oid-output-format-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<em><code class="parameter">oid_format</code></em></dt>

     <dd>

      <table class="doctable table">
       <caption><strong>OID .1.3.6.1.2.1.1.3.0 representation for various <em><code class="parameter">oid_format</code></em> values</strong></caption>
        
         <tbody class="tbody">
          <tr><td><strong><code>SNMP_OID_OUTPUT_FULL</code></strong></td><td>.iso.org.dod.internet.mgmt.mib-2.system.sysUpTime.sysUpTimeInstance</td></tr>

          <tr><td><strong><code>SNMP_OID_OUTPUT_NUMERIC</code></strong></td><td>.1.3.6.1.2.1.1.3.0</td> </tr>

         </tbody>
        
       </table>

       <p class="para">Begining from PHP 5.4.0 four additional constants available:
        <table class="doctable table">
         
         
          <tbody class="tbody">
           <tr><td><strong><code>SNMP_OID_OUTPUT_MODULE</code></strong></td><td>DISMAN-EVENT-MIB::sysUpTimeInstance</td></tr>

           <tr><td><strong><code>SNMP_OID_OUTPUT_SUFFIX</code></strong></td><td>sysUpTimeInstance</td></tr>

           <tr><td><strong><code>SNMP_OID_OUTPUT_UCD</code></strong></td><td>system.sysUpTime.sysUpTimeInstance</td></tr>

           <tr><td><strong><code>SNMP_OID_OUTPUT_NONE</code></strong></td><td>Undefined</td></tr>

          </tbody>
         
        </table>
 
       </p>
     </dd>

    
   </dl>

  </p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-function.snmp-set-oid-output-format-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   没有返回值。
  </p>
 </div>

 
 <div class="refsect1 notes" id="refsect1-function.snmp-set-oid-output-format-notes">
  <h3 class="title">注释</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    <span class="function"><strong>snmp_set_oid_output_format()</strong></span> is only available when using
    the UCD SNMP library.  This function is not available when using the
    Windows SNMP library.
   </p>
  </p></blockquote>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.snmp-set-oid-output-format-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-4459">
    <p><strong>Example #1 Using <span class="function"><a href="function.snmprealwalk.html" class="function">snmprealwalk()</a></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />&nbsp;snmp_read_mib</span><span style="color: #007700">(</span><span style="color: #DD0000">"/usr/share/mibs/netsnmp/NET-SNMP-TC"</span><span style="color: #007700">);<br /><br />&nbsp;</span><span style="color: #FF8000">//&nbsp;default&nbsp;or&nbsp;SNMP_OID_OUTPUT_MODULE&nbsp;in&nbsp;PHP&nbsp;&gt;=&nbsp;5.3.6<br />&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">snmprealwalk</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'public'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'RFC1213-MIB::sysObjectID'</span><span style="color: #007700">)&nbsp;);<br /><br />&nbsp;</span><span style="color: #0000BB">snmp_set_oid_output_format</span><span style="color: #007700">(</span><span style="color: #0000BB">SNMP_OID_OUTPUT_NUMERIC</span><span style="color: #007700">);<br />&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">snmprealwalk</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'public'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'RFC1213-MIB::sysObjectID'</span><span style="color: #007700">)&nbsp;);<br /><br />&nbsp;</span><span style="color: #0000BB">snmp_set_oid_output_format</span><span style="color: #007700">(</span><span style="color: #0000BB">SNMP_OID_OUTPUT_FULL</span><span style="color: #007700">);<br />&nbsp;</span><span style="color: #0000BB">print_r</span><span style="color: #007700">(&nbsp;</span><span style="color: #0000BB">snmprealwalk</span><span style="color: #007700">(</span><span style="color: #DD0000">'localhost'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'public'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'RFC1213-MIB::sysObjectID'</span><span style="color: #007700">)&nbsp;);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    
    <div class="example-contents"><p>
     The above would output:
<div class="cdata"><pre>
 Array
 (
    [RFC1213-MIB::sysObjectID.0] =&gt; OID: NET-SNMP-TC::linux
 )
 Array
 (
    [.1.3.6.1.2.1.1.2.0] =&gt; OID: .1.3.6.1.4.1.8072.3.2.10
 )
 Array
 (
    [.iso.org.dod.internet.mgmt.mib-2.system.sysObjectID.0] =&gt; OID: .iso.org.dod.internet.private.enterprises.netSnmp.netSnmpEnumerations.netSnmpAgentOIDs.linux
 )
</pre></div>
    </p></div>
   </div>
  </p>
 </div>

 
 
</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.snmp-set-oid-numeric-print.html">snmp_set_oid_numeric_print</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.snmp-set-quick-print.html">snmp_set_quick_print</a></div>
 <div class="up"><a href="ref.snmp.html">SNMP 函数</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
